package www.lagou.entity;

import java.util.Date;

/**
 * JavaBean类
 *      用来存储数据 成员变量私有 提供get set 提供空参  实现序列化接口
 *
 * Phone 就是对应了 数据库Test_01中 phone 表
 *  id INT PRIMARY KEY  AUTO_INCREMENT,
 *  pname VARCHAR(20),-- 手机名称
 *  price DOUBLE , -- 手机单价
 *  prodate DATE , -- 生产日期
 *  color VARCHAR(20) -- 颜色
 */

public class Phone {

    private int id;
    private String pname;   //手机名称
    private double prive;   //手机单价
    private Date prodate;   //生产日期
    private String color;   //颜色

    public Phone() {
    }

    public Phone(int id, String pname, double prive, Date prodate, String color) {
        this.id = id;
        this.pname = pname;
        this.prive = prive;
        this.prodate = prodate;
        this.color = color;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public double getPrive() {
        return prive;
    }

    public void setPrive(double prive) {
        this.prive = prive;
    }

    public Date getProdate() {
        return prodate;
    }

    public void setProdate(Date prodate) {
        this.prodate = prodate;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "id=" + id +
                ", pname='" + pname + '\'' +
                ", prive=" + prive +
                ", prodate=" + prodate +
                ", color='" + color + '\'' +
                '}';
    }
}
